package com.ad.pet.app.mall.adapter;

import android.graphics.Paint;
import android.support.annotation.Nullable;
import android.widget.ImageView;
import android.widget.TextView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.ad.pet.R;
import com.ad.pet.common.data.utils.glide.GlideUtil;
import com.ad.pet.models.remote.cart.Good;

import java.util.List;

/**
 * Created by SEELE on 2019/7/12.
 */

public class FlashBuyAdapter extends BaseQuickAdapter<Good, BaseViewHolder> {
    public FlashBuyAdapter(@Nullable List<Good> data) {
        super(R.layout.item_flash_buy_good_list, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, Good item) {

        TextView tvTitleName = helper.getView(R.id.tv_title_name);
        ImageView ivHead = helper.getView(R.id.iv_pic);
        TextView tvOldPrice = helper.getView(R.id.tv_old_price);
        TextView tvPrice = helper.getView(R.id.tv_price);
        TextView tvDetail = helper.getView(R.id.tv_title);

        tvTitleName.setText(item.getProduct_name());
        tvPrice.setText(item.getDiscount());
        GlideUtil.load(mContext,item.getImg(),ivHead);
        tvOldPrice.getPaint().setFlags(Paint.STRIKE_THRU_TEXT_FLAG);
        tvOldPrice.setText(mContext.getString(R.string.yuanjia)+"US $"+item.getPrice());
    }
}
